<?php

define("COUNTER_COOKIE_NAME","Swing_Counter"); //definicia nazvu cookie



//-------------------------------------------------------------------
//Nazov:		generate_info
//Popis:		
//Navrat.hodn:	string
//-------------------------------------------------------------------
function generate_info($Type_ID,$Type){
	$sql_array = mysql_fetch_array(mysql_query("SELECT Value FROM top_menu_text WHERE ((Type_ID=$Type_ID) AND (Type='$Type'))"));
	return $sql_array["Value"];
}

//-------------------------------------------------------------------
//Nazov:		get_caption
//Popis:		
//Navrat.hodn:	string
//-------------------------------------------------------------------
function get_caption($Type_ID,$Type){
	if($Type=="MENU"){
		//menu
		$sql_array = mysql_fetch_array(mysql_query("SELECT SC_Caption FROM top_menu_sub_category WHERE $Type_ID=ID"));
		return $sql_array["SC_Caption"];
	}
	
	if($Type=="NEWS"){
  		//news
  		$sql_array = mysql_fetch_array(mysql_query("SELECT News_Caption FROM top_menu_news WHERE $Type_ID=ID"));
		return $sql_array["News_Caption"];
  	}
}

//-------------------------------------------------------------------
//Nazov:		get_caption
//Popis:		
//Navrat.hodn:	string
//-------------------------------------------------------------------
function update_caption($Type_ID,$Type,$information_caption){
	if($Type=="MENU"){
		//menu
		mysql_query("UPDATE top_menu_sub_category SET SC_Caption='$information_caption' WHERE $Type_ID=ID");

	}
	
	if($Type=="NEWS"){
  		//news
		mysql_query("UPDATE top_menu_news SET News_Caption='$information_caption' WHERE $Type_ID=ID");
  	}
}

?>